home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / nosvw137.zip / TCP < prev    next >
Text File  |  1991-09-18  |  14KB  |  286 lines

  1. ===                                                 NOSview [137]
  2. tcp
  3. ===
  4.  
  5. The 'tcp' commands are used for the Transmission Control Protocol
  6. (TCP) service.
  7.  
  8. _________________________________________________________________
  9. tcp irtt [<milliseconds>]                           Default: 5000
  10. _________________________________________________________________
  11. Display or set the initial-round-trip-time (IRTT) estimate, to be
  12. used for new TCP connections until they can measure and adapt to
  13. the actual value.
  14.  
  15. Increasing the value of IRTT when operating over slow channels
  16. will avoid the flurry of retransmissions that would otherwise
  17. occur as the smoothed estimate settles down at the correct value.
  18.  
  19. Note that this command should be given before servers are started
  20. in order for it to have effect on incoming connections.
  21.  
  22. TCP also keeps a cache of measured round trip times and mean
  23. deviations (MDEV) for current and recent destinations.  Whenever
  24. a new TCP connection is opened, the system first looks in this
  25. cache.  If the destination is found, the cached IRTT and MDEV
  26. values are used.  If not, the default IRTT value mentioned above
  27. is used, along with a MDEV of 0. This feature is fully automatic,
  28. and it can improve performance greatly when a series of
  29. connections are opened and closed to a given destination (e.g. a
  30. series of FTP file transfers or directory listings).
  31.  
  32. >> Example:  tcp irtt 5000
  33.  
  34.  
  35. _________________________________________________________________
  36. tcp kick <&TCB>
  37. _________________________________________________________________
  38. If there is unacknowledged data on the send queue of the
  39. specified Transmission Control Block (TCB), this command forces
  40. an immediate retransmission.   The TCB address <&TCB> can be
  41. determined from the 'tcp status' command.
  42.  
  43. >> Example:  tcp kick 83360008
  44.  
  45.  
  46. _________________________________________________________________
  47. tcp mss [<bytes>]                                    Default: 512
  48. _________________________________________________________________
  49. Display or set the TCP Maximum Segment Size (MSS).  MSS is
  50. parameter that limits the amount of data that the remote TCP will
  51. send in a single TCP packet.  MSS values are exchanged in the SYN
  52. (connection request) packets that open a TCP connection.
  53.  
  54. In the NOS implementation of TCP, the MSS actually used by TCP is
  55. further reduced in order to avoid fragmentation at the local IP
  56. interface.  That is, the local TCP asks IP for the MTU of the
  57. interface that will be used to reach the destination.  It then
  58. subtracts 40 from the MTU value to allow for the overhead of the
  59. TCP and IP headers.  If the result is less than the MSS received
  60. from the remote TCP, it is used instead.
  61.  
  62. The setting of this TCP-level parameter is somewhat less critical
  63. than the IP MTU and AX.25 <paclen> parameters, mainly because it
  64. is automatically lowered according to the MTU of the local
  65. interface when a connection is created, as described above.
  66. Although this is, strictly speaking, a protocol layering
  67. violation (TCP is not supposed to have any knowledge of the
  68. workings of lower layers) this technique does work well in
  69. practice.
  70.  
  71. However, it can be fooled; for example, if a routing change
  72. occurs after the connection has been opened and the new local
  73. interface has a smaller MTU than the previous one, IP
  74. fragmentation may occur in the local system.
  75.  
  76. The only drawback to setting a large MSS is that it might cause
  77. avoidable fragmentation at some other point within the network
  78. path if it includes a "bottleneck" subnet with an MTU smaller
  79. than that of the local interface.  (Unfortunately, there is
  80. presently no way to know when this is the case.  There is ongoing
  81. work within the Internet Engineering Task Force on an "MTU
  82. Discovery" procedure to determine the largest datagram that may
  83. be sent over a given path without fragmentation, but this work is
  84. not yet complete).
  85.  
  86. Also, since the MSS you specify is sent to the remote system, and
  87. not all other TCPs do the MSS-lowering procedure yet, this might
  88. cause the remote system to generate IP fragments unnecessarily.
  89. On the other hand, a too-small MSS can result in a considerable
  90. performance loss, especially when operating over fast LANs and
  91. networks that can handle larger packets.
  92.  
  93. So the best value for MSS is probably 40 less than the largest
  94. MTU on your system, with the 40-byte margin allowing for the TCP
  95. and IP headers.  For example, if you have a SLIP interface with a
  96. 1006 byte MTU and an Ethernet interface with a 1500 byte MTU, set
  97. MSS to 1460 bytes.  This allows you to receive maximum-sized
  98. Ethernet packets, assuming the path to your system does not have
  99. any bottleneck subnets with smaller MTUs.
  100.  
  101. An MSS of 216 corresponds to the MTU of 256 set up in AX.25
  102. 'attach' commands.
  103.  
  104. Changing MSS affects only future connections; existing
  105. connections are unaffected.
  106.  
  107. >> Examples:  tcp mss 216      (for an AX.25-only system)
  108.               tcp mss 966      (for a SLIP system)
  109.               tcp mss 1460     (for an Ethernet or PPP system)
  110.  
  111.  
  112. _________________________________________________________________
  113. tcp reset <&TCB>
  114. _________________________________________________________________
  115. Deletes the TCP control block at the specified address <&TCB>.
  116.  
  117. >> Example:  tcp reset 83360008
  118.  
  119.  
  120. _________________________________________________________________
  121. tcp rtt <&TCB> <milliseconds>
  122. _________________________________________________________________
  123. Replaces the automatically computed round-trip-time in the
  124. specified TCB with the rtt in milliseconds.  This command is
  125. useful to speed up recovery from a series of lost packets since
  126. it provides a manual bypass around the normal backoff
  127. retransmission timing mechanisms.
  128.  
  129. >> Example:  tcp rtt 83360008 3000
  130.  
  131.  
  132. _________________________________________________________________
  133. tcp status [<&TCB>]
  134. _________________________________________________________________
  135. Without arguments, displays several TCP-level statistics, plus a
  136. summary of all existing TCP connections, including TCB address,
  137. send and receive queue sizes, local and remote sockets, and
  138. connection state.
  139.  
  140. If <&TCB> is specified, a more detailed dump of the specified TCB
  141. is generated, including send and receive sequence numbers and
  142. timer information.
  143.  
  144. >> Example of 'tnc status' output:
  145. ...............................................................
  146. :                                                             :
  147. :( 1)tcpRtoAlgorithm         4   ( 2)tcpRtoMin               0:
  148. :( 3)tcpRtoMax      4294967295   ( 4)tcpMaxConn     4294967295:
  149. :( 5)tcpActiveOpens          2   ( 6)tcpPassiveOpens         2:
  150. :( 7)tcpAttemptFails         0   ( 8)tcpEstabResets          0:
  151. :( 9)tcpCurrEstab            4   (10)tcpInSegs              10:
  152. :(11)tcpOutSegs             10   (12)tcpRetransSegs          0:
  153. :(14)tcpInErrs               0   (15)tcpOutRsts              0:
  154. :                                                             :
  155. :  &TCB   Rcv Snd Local socket    Remote socket  State        :
  156. :          Q   Q                                              :
  157. :858c0008  0   0  ns9bob:ftp      ns9ken:1025   Established   :
  158. :85050008  0   0  ns9bob:1025     ns9liz:ftp    Established   :
  159. :841f0008  0   0  0.0.0.0:ftp     0.0.0.0:0     Listen (S)    :
  160. :83360008  0   0  ns9bob:telnet   ns9liz:1024   Established   :
  161. :7d530008  0   0  ns9bob:1024     ns9jim:telnet Established   :
  162. :840d0008  0   0  0.0.0.0:telnet  0.0.0.0:0     Listen (S)    :
  163. :845b0008  0   0  0.0.0.0:ttylink 0.0.0.0:0     Listen (S)    :
  164. :84400008  0   0  0.0.0.0:finger  0.0.0.0:0     Listen (S)    :
  165. :84310008  0   0  0.0.0.0:smtp    0.0.0.0:0     Listen (S)    :
  166. :83fb0008  0   0  0.0.0.0:discard 0.0.0.0:0     Listen (S)    :
  167. :83ec0008  0   0  0.0.0.0:echo    0.0.0.0:0     Listen (S)    :
  168. :.............................................................:
  169.  
  170.  
  171. >> Example of 'tcp status 83360008' output:
  172. ...............................................................
  173. :Local: ns9bob:telnet Remote: ns9liz:1024 State: Established  :
  174. :     Init seq  Unack   Next  Re- CW Thrsh  Wind MSS Q Total  :
  175. :                            sent ind                         :
  176. :Send: 2b66000 2b66026 2b66026  0 216 65535  216 216 0  37    :
  177. :Recv: 2b66000         2b66001  0            216     0   0    :
  178. :Timer stopped SRTT 49779 ms Mean dev 26384 ms                :
  179. :.............................................................:
  180.  
  181.  
  182. _________________________________________________________________
  183. tcp syndata [on|off]                                 Default: off
  184. _________________________________________________________________
  185. Display or set the "syndata" flag.  When set to 'on', SYN and
  186. data are piggybacked.  This reduces transmission time, as the
  187. sending end does not have to wait for an acknowledgement to the
  188. SYN before sending data.
  189.  
  190. >> Example:  tcp syndata on
  191.  
  192.  
  193. _________________________________________________________________
  194. tcp timertype [linear|exponential]
  195. _________________________________________________________________
  196. The TCP timer backoff can be either linear or binary exponential.
  197. Linear backoff is recommended for amateur radio work.
  198.  
  199. >> Example:  tcp timertype linear
  200.  
  201.  
  202. _________________________________________________________________
  203. tcp trace [on|off]                                   Default: off
  204. _________________________________________________________________
  205. Display or set TCP trace mode.  When set to 'on', task control
  206. block activity is displayed, together with numbered TCP protocol
  207. messages.
  208.  
  209. >>  Example:  tcp trace on
  210.               ftp ns9aaa
  211.  
  212.     produces an output of the form:
  213. ...............................................................
  214. :                                                             :
  215. :TCB 862b0008 Closed -> SYN sent                              :
  216. :TCB 89d90008 Listen -> SYN received                          :
  217. :Resolving ns9aaa... Trying ns9aaa:ftp...                     :
  218. :TCB 862b0008 SYN sent -> Established                         :
  219. :FTP session 3 connected to ns9aaa                            :
  220. :TCB 89d90008 SYN received -> Established                     :
  221. :220 ns9aaa FTP version 910618 (PA0GRI v1.7a) ready ....      :
  222. :Enter user name: helen                                       :
  223. :331 Enter PASS command                                       :
  224. :Password:                                                    :
  225. :230 Logged in                                                :
  226. :ftp> pwd                                                     :
  227. :257 "/nos/public" is current directory                       :
  228. :.............................................................:
  229.  
  230.  
  231. _________________________________________________________________
  232. tcp window [<bytes>]                                Default: 2048
  233. _________________________________________________________________
  234. Displays or sets the default receive window size.  This is a TCP-
  235. level parameter that controls how much data the local TCP will
  236. allow the remote TCP to send before it must stop and wait for an
  237. acknowledgement.
  238.  
  239. If the window size is twice as big as the Maximum Segment Size
  240. (MSS), for example, there will be two active packets on the
  241. channel at any given time.  Large values of window size provide
  242. improved throughput on full-duplex links, but are a problem on
  243. the air.
  244.  
  245. The actual window value used by TCP when deciding how much more
  246. data to send is referred to as the effective window.  This is the
  247. smaller of two values: the window advertised by the remote TCP
  248. minus the unacknowledged data in flight, and the congestion
  249. window, an automatically computed time-varying estimate of how
  250. much data the network can handle.
  251.  
  252. In most cases it is safe to set the TCP window to a small integer
  253. multiple of the MSS (e.g. 4 times), or larger if necessary to
  254. fully utilize a high bandwidth*delay product path.  One thing to
  255. keep in mind, however, is that advertising a certain TCP window
  256. value declares that the system has that much buffer space
  257. available for incoming data.  NOS does not actually preallocate
  258. this space; it keeps it in a common pool and may well "overbook"
  259. it, exploiting the fact that many TCP connections are idle for
  260. long periods and gambling that most applications will read
  261. incoming data from an active connection as soon as it arrives,
  262. thereby quickly freeing the buffer memory.
  263.  
  264. However, it is possible to run NOS out of memory if excessive TCP
  265. window sizes are advertised and either the applications go to
  266. sleep indefinitely (e.g. suspended Telnet sessions) or a lot of
  267. out-of-sequence data arrives.  It is wise to keep an eye on the
  268. amount of available memory and to decrease the TCP window size
  269. (or limit the number of simultaneous connections) if it gets too
  270. low.
  271.  
  272. Depending on the channel access method and link level protocol,
  273. the use of a window setting that exceeds the MSS may cause an
  274. increase in channel collisions.  In particular, collisions
  275. between data packets and returning acknowledgements during a bulk
  276. file transfer may become common.  Although this is, strictly
  277. speaking, not TCP's fault, it is possible to work around the
  278. problem at the TCP level by decreasing the window so that the
  279. protocol operates in stop-and-wait mode.  This is done by making
  280. the window value equal to the MSS.
  281.  
  282. In summary, therefore, keep MSS <= window <= 2*MSS for half-
  283. duplex radio links.
  284.  
  285. >> Example:  tcp window 216
  286.